﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ESRI.ArcGIS.Client;
using ESRI.ArcGIS.Client.Symbols;

using GISforTT_API;

namespace eGrid_App
{
    /// <summary>
    /// A trouble ticket, with a reference to the corresponding graphic on the map.
    /// </summary>
    public class TroubleTicket : Graphic
    {
        public Graphic originalGraphic;

        /// <summary>
        /// Set the graphical reflection of the trouble ticket's priority / severity, 1, 2 or 3.
        /// </summary>
        public int Priority
        {
            set
            {
                switch (value)
                {
                    case 1:
                        Symbol = (PictureMarkerSymbol)BackgroundMapLayer.Instance.getBackgroundMap().MainGrid.Resources["GreenTicket"];
                        break;
                    case 2:
                        Symbol = (PictureMarkerSymbol)BackgroundMapLayer.Instance.getBackgroundMap().MainGrid.Resources["OrangeTicket"];
                        break;
                    case 3:
                        Symbol = (PictureMarkerSymbol)BackgroundMapLayer.Instance.getBackgroundMap().MainGrid.Resources["RedTicket"];
                        break;
                }

            }
        }

    }
}
